// ArrayInit.java
package com.ylaihui.array;

public class ArrayInit {
	public static void main(String[] args) {
		// 静态初始化
		int[] array;
		array = new int[]{1,2,3,4,5};
		
		// 动态初始化
		int[] array2 = new int[5];
		array2[0] = 1;
		array2[1] = 2;
		array2[2] = 3;
		array2[3] = 4;
		array2[4] = 5;
		
		//错误的写法
		/*int [] array3 = new int[3] {1,2,3};*/
	}
}
